﻿using System;
using System.Collections.Generic;

namespace IDesktop.Core
{
    public class IDesktopCore
    {
        private static string _baseImagePath = "/IDesktop;component/Resource/FlipAnim/Digitals";
        private readonly string _currentImage = _baseImagePath + "/" + "{0}(" + "{1})" + ".png";

        public Dictionary<string, string> GetCurrentImage(DateTime time, DigitalZone zone) {
            Dictionary<string, string> result = new Dictionary<string, string>();
            int hour = time.Hour;
            int minute = time.Minute;
            switch ((int)zone) {
                case 1:
                case 2:
                case 3:
                    result.Add("HourUnits", string.Format(_currentImage, (hour % 10).ToString(), "{0}"));
                    result.Add("HourTens", string.Format(_currentImage, (hour / 10).ToString(), "{0}"));
                    break;
                case 4:
                case 8:
                case 12:
                    result.Add("MinuteTens", string.Format(_currentImage, (minute / 10).ToString(), "{0}"));
                    result.Add("MinuteUnits", string.Format(_currentImage, (minute % 10).ToString(), "{0}"));
                    break;
                case 15:
                    break;
            }
            return result;
        }

    }
}
